﻿'Imports MySql.Data.MySqlClient
'Imports System.Data
Imports System
Imports System.Net
Imports System.IO
Imports Microsoft.Win32
Imports Microsoft.Win32.Registry
Imports Microsoft.Win32.RegistryKey

Public Class frmGrade
    'Dim classname As String
    'Dim assignmentname As String
    'Dim userid As String 'this is the current logged on user ID - not name
    'Public downloadedClasses As Boolean
    'Public courseids As New List(Of String)
    'Dim savepath As String
    'Dim username As String
    'Dim assignmentid As Integer 'current selected assignment ID
    'Dim courseid As Integer 'single course id to determine a specific assignment
    'Dim usersidthatsubmittedassingments As New List(Of String)
    'Dim usersidsthatdidnotsubmit As New List(Of String)
    'Dim student As New List(Of Student)
    'Dim assignmentvalue As Integer


    'Private Sub cboAssignment_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboAssignment.SelectedIndexChanged
    '    'Dim mysqlServer As MySqlConnection
    '    'Dim myCommand As New MySqlCommand
    '    Dim assignmentSQL As String
    '    Dim assignmentnames As New List(Of String)
    '    Dim usersthatsubmittedassingments As New List(Of String)
    '    Dim usersinclass As New List(Of String)
    '    Dim instanceid As Integer
    '    Dim instanceidSQL As String
    '    Dim classStudentsSQL As String
    '    Dim assignmentidSQL

    '    lstStudents.Items.Clear()
    '    lstNotSubmitted.Items.Clear()
    '    usersthatsubmittedassingments.Clear()
    '    usersinclass.Clear()
    '    usersidthatsubmittedassingments.Clear()
    '    assignmentname = cboAssignment.SelectedItem

    '    'mysqlServer = New MySqlConnection() 'This needs to be able to be changed to what frmSettings.txtServer is saved to
    '    'mysqlServer.ConnectionString = frmSplash.SQLConnection1.getConnectionString

    '    Try
    '        'mysqlServer.Open()
    '        'Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '    End Try

    '    'Translate assignment name to SQL ID TAG
    '    assignmentidSQL = "select id from mdl_assignment where name = """ & cboAssignment.Items.Item(cboAssignment.SelectedIndex) & """"

    '    'Dim reader As MySqlDataReader
    '    'myCommand.Connection = mysqlServer
    '    'myCommand.CommandText = assignmentidSQL
    '    'reader = myCommand.ExecuteReader()
    '    'While reader.Read()
    '    'assignmentid = reader.GetString(0)
    '    'End While
    '    'reader.Close()

    '    '-------------------------------------------------------------------------------------------------

    '    'Fetches all userids who submitted assignments to a particular assignment
    '    'Dim tempvar1 As Integer
    '    'tempvar1 = 0
    '    assignmentSQL = "select userid from mdl_assignment_submissions where assignment =" & assignmentid
    '    'myCommand.CommandText = assignmentSQL
    '    'reader = myCommand.ExecuteReader()
    '    'While reader.Read()
    '    'usersidthatsubmittedassingments.Add(reader.GetString(0))
    '    'tempvar1 += 1
    '    'End While
    '    'reader.Close()
    '    'MsgBox("Total submissions: " & tempvar1 & "")

    '    '---------------------------------------------------------------------------------------------------

    '    'links courses, assignments, and assignment submissions... I guess
    '    instanceidSQL = "select id from mdl_context where contextlevel= 50 and instanceid = " & courseids.Item(cboClass.SelectedIndex)
    '    myCommand.CommandText = instanceidSQL
    '    reader = myCommand.ExecuteReader()
    '    While reader.Read()
    '        instanceid = reader.GetString(0)
    '    End While
    '    reader.Close()

    '    '----------------------------------------------------------------------------------------------------

    '    'links courses, assignments, and assignment submissions... I guess
    '    classStudentsSQL = "select userid from mdl_role_assignments where contextid = " & instanceid
    '    myCommand.CommandText = classStudentsSQL
    '    reader = myCommand.ExecuteReader()
    '    While reader.Read()
    '        usersinclass.Add(reader.GetString(0))
    '    End While
    '    reader.Close()

    '    '----------------------------------------------------------------------------------------------------

    '    Dim g As Integer
    '    g = 0
    '    'Collecting information only about the students who submitted the assignment
    '    While g < usersidthatsubmittedassingments.Count
    '        assignmentSQL = "select firstname , lastname from mdl_user where id = " & usersidthatsubmittedassingments.Item(g)
    '        myCommand.CommandText = assignmentSQL
    '        reader = myCommand.ExecuteReader()
    '        While reader.Read()
    '            usersthatsubmittedassingments.Add(reader.GetString(0) & " " & reader.GetString(1))
    '            student.Add(New Student(reader.GetString(0), reader.GetString(1), usersidthatsubmittedassingments.Item(g)))
    '        End While
    '        reader.Close()
    '        g += 1
    '    End While

    '    '----------------------------------------------------------------------------------------------------
    '    'Populates lstStudents with only the ones that actually have submitted the assignment
    '    Dim f As Integer
    '    f = 0
    '    Dim h As Integer
    '    h = 0
    '    Dim r As Integer
    '    r = 0
    '    Dim notfound As Boolean
    '    While (usersinclass.Count > f)
    '        h = 0
    '        While (usersidthatsubmittedassingments.Count > h)

    '            If (usersinclass.Item(f) = usersidthatsubmittedassingments(h)) Then
    '                lstStudents.Items.Add(usersthatsubmittedassingments.Item(h))
    '                notfound = False
    '                Exit While
    '            Else
    '                notfound = True
    '            End If
    '            h += 1
    '        End While
    '        If notfound = True Then
    '            lstNotSubmitted.Items.Add(usersinclass.Item(f))
    '        End If
    '        f += 1
    '    End While


    '    '----------------------------------------------------------------------------------------------------
    '    'Translates the assignment name to its SQL ID
    '    'need to add an additional where clause for assignments that have the same name in different courses
    '    'probly should not run this sql command
    '    assignmentidSQL = "select id from mdl_assignment where name = """ & assignmentname & """;"
    '    myCommand.Connection = mysqlServer
    '    myCommand.CommandText = assignmentidSQL
    '    reader = myCommand.ExecuteReader()
    '    While reader.Read()
    '        assignmentid = reader.GetString(0)
    '    End While
    '    reader.Close()

    '    '----------------------------------------------------------------------------------------------------

    '    If mysqlServer.State <> ConnectionState.Closed Then mysqlServer.Close()

    '    Call showassignmentvalue()
    'End Sub

    'Public Function getclasses() 'Populate cboClass
    '    Dim contextSQL
    '    Dim classSQL
    '    Dim courseSQL
    '    Dim coursenameSQL
    '    Dim mysqlServer As MySqlConnection
    '    Dim myCommand As New MySqlCommand
    '    mysqlServer = New MySqlConnection() 'This needs to be able to be changed to what frmSettings.txtServer is saved to
    '    mysqlServer.ConnectionString = frmSplash.SQLConnection1.getConnectionString

    '    userid = frmSplash.userid

    '    Dim contexts As New List(Of String)
    '    Dim coursecontextid As New List(Of String)
    '    Dim coursenumbers As New List(Of String)
    '    Dim coursename As New List(Of String)
    '    Dim i As Integer
    '    'MsgBox(userid)
    '    contextSQL = "select id from mdl_context where contextlevel = 50;"
    '    Try
    '        mysqlServer.Open()
    '        Try
    '            myCommand.Connection = mysqlServer
    '            myCommand.CommandText = contextSQL

    '            Dim reader As MySqlDataReader
    '            reader = myCommand.ExecuteReader()

    '            i = 0
    '            While reader.Read()
    '                contexts.Add(reader.GetString(0))
    '            End While
    '            reader.Close()

    '            i = 0
    '            'While (i < contexts.Count)
    '            ' MsgBox(contexts.Item(i))
    '            'i += 1
    '            ' End While
    '            Dim p As Integer
    '            p = 0
    '            While (contexts.Count() > 0)
    '                classSQL = "select roleid from mdl_role_assignments where contextid = " & contexts.Item(0) & _
    '                 " and userid = " & userid

    '                myCommand.Connection = mysqlServer
    '                myCommand.CommandText = classSQL
    '                reader = myCommand.ExecuteReader()
    '                While reader.Read()
    '                    ' MsgBox(reader.GetString(0))
    '                    'If (reader.GetString(0) > 5) Then
    '                    coursecontextid.Add(contexts.Item(0))
    '                    '  MsgBox(contexts.Item(0))
    '                    'End If
    '                End While
    '                reader.Close()
    '                ' MsgBox(contexts.Count())
    '                contexts.RemoveAt(0)
    '                p += 1
    '            End While

    '            i = 0
    '            ' While (i < coursecontextid.Count)
    '            'MsgBox(coursecontextid.Item(i))
    '            'i += 1
    '            'End While
    '            'MsgBox("end while")
    '            Dim f As Integer
    '            f = 0
    '            p = 0
    '            While (coursecontextid.Count() > p)
    '                courseSQL = "select instanceid from mdl_context where id = " & coursecontextid.Item(p)
    '                myCommand.Connection = mysqlServer
    '                myCommand.CommandText = courseSQL
    '                reader = myCommand.ExecuteReader()
    '                While reader.Read()
    '                    ' MsgBox(reader.GetString(0))
    '                    coursenumbers.Add(reader.GetString(0))
    '                End While
    '                reader.Close()
    '                p += 1
    '            End While
    '            p = 0
    '            While (coursenumbers.Count() > p)
    '                coursenameSQL = "select fullname from mdl_course where id = " & coursenumbers.Item(p)
    '                myCommand.Connection = mysqlServer
    '                myCommand.CommandText = coursenameSQL
    '                reader = myCommand.ExecuteReader()
    '                While reader.Read()
    '                    ' MsgBox(reader.GetString(0))
    '                    coursename.Add(reader.GetString(0))
    '                End While
    '                reader.Close()
    '                p += 1
    '            End While
    '            'MsgBox("end while")
    '        Catch myerror As MySqlException
    '            MsgBox("There was an error reading from the database: " & myerror.Message)
    '        End Try
    '    Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '    Finally
    '        If mysqlServer.State <> ConnectionState.Closed Then mysqlServer.Close()
    '    End Try
    '    'MsgBox(coursenumbers.ToString, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "Error")
    '    i = 0
    '    ' While (i < coursenumbers.Count)
    '    'MsgBox(coursenumbers.Item(i))
    '    ' i += 1
    '    ' End While
    '    Dim g As Integer
    '    g = 0

    '    While (coursename.Count() - 1 > g)
    '        If (coursename.Item(g + 1) <> coursename.Item(g)) Then
    '            courseids.Add(coursenumbers.Item(g))
    '            cboClass.Items.Add(coursename.Item(g))
    '        End If
    '        g += 1
    '    End While
    '    cboClass.Items.Add(coursename.Item(coursename.Count() - 1))
    '    courseids.Add(coursenumbers.Item(coursename.Count() - 1))
    '    Return True
    'End Function

    'Public Sub showassignmentvalue()
    '    'Gets the defined grade of the current assignment
    '    Dim mysqlServer As MySqlConnection
    '    Dim myCommand As New MySqlCommand
    '    Dim reader As MySqlDataReader
    '    mysqlServer = New MySqlConnection() 'This needs to be able to be changed to what frmSettings.txtServer is saved to
    '    mysqlServer.ConnectionString = frmSplash.SQLConnection1.getConnectionString
    '    Try
    '        mysqlServer.Open()
    '    Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '    End Try


    '    Dim assignmentvalueSQL
    '    'Translate the course name to it's SQL ID
    '    assignmentvalueSQL = "select grade from mdl_assignment where id = " & assignmentid & ";"
    '    myCommand.Connection = mysqlServer
    '    myCommand.CommandText = assignmentvalueSQL
    '    reader = myCommand.ExecuteReader()
    '    While reader.Read()
    '        assignmentvalue = reader.GetString(0)
    '        assignmentvalue = Convert.ToInt32(assignmentvalue)
    '    End While
    '    reader.Close()
    '    txtStatus.Text = "The current value is: " & assignmentvalue & " points"
    '    If mysqlServer.State <> ConnectionState.Closed Then mysqlServer.Close()

    'End Sub

    'Private Sub frmGrade_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
    '    Me.Hide()
    '    frmMain.Show()
    '    frmMain.Focus()
    'End Sub

    'Private Sub frmGrade_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    '    Call getclasses()
    'End Sub

    'Private Sub cboClass_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboClass.SelectedIndexChanged
    '    Dim mysqlServer As MySqlConnection
    '    Dim myCommand As New MySqlCommand
    '    Dim assignmentSQL As String
    '    Dim assignmentnames As New List(Of String)

    '    cboAssignment.Items.Clear()
    '    classname = cboClass.SelectedItem

    '    mysqlServer = New MySqlConnection() 'This needs to be able to be changed to what frmSettings.txtServer is saved to
    '    mysqlServer.ConnectionString = frmSplash.SQLConnection1.getConnectionString

    '    assignmentSQL = "select name from mdl_assignment where course = " & courseids.Item(cboClass.SelectedIndex)
    '    Try
    '        mysqlServer.Open()
    '        Try
    '            myCommand.Connection = mysqlServer
    '            myCommand.CommandText = assignmentSQL
    '            Dim reader As MySqlDataReader
    '            reader = myCommand.ExecuteReader()
    '            While reader.Read()
    '                assignmentnames.Add(reader.GetString(0))
    '            End While
    '            reader.Close()
    '        Catch myerror As MySqlException
    '            MsgBox("There was an error reading from the database: " & myerror.Message)
    '        End Try
    '    Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '    Finally
    '        If mysqlServer.State <> ConnectionState.Closed Then mysqlServer.Close()
    '    End Try
    '    Dim p As Integer
    '    p = 0
    '    While (assignmentnames.Count > p)
    '        cboAssignment.Items.Add(assignmentnames.Item(p))
    '        p += 1
    '    End While
    'End Sub

    'Private Sub cmdOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOpen.Click
    '    Dim regKey As RegistryKey
    '    regKey = Registry.CurrentUser.OpenSubKey("Software\moodle\settings")
    '    savepath = regKey.GetValue("savepath") & "\"
    '    If savepath.Equals("\") Then
    '        savepath = "C:\data\"
    '    End If
    '    savepath = "" + savepath + classname & "\" & assignmentname & "\" & username + ""

    '    Try
    '        System.Diagnostics.Process.Start(savepath)
    '    Catch
    '        MsgBox("You cannot access this assignment because you have not downloaded it yet.", MsgBoxStyle.Exclamation, "No Files Found")
    '    End Try
    'End Sub

    'Private Sub lstStudents_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstStudents.SelectedIndexChanged
    '    username = lstStudents.SelectedItem
    '    Dim mysqlServer As MySqlConnection
    '    Dim myCommand As New MySqlCommand
    '    Dim studentgradeSQL As String
    '    Dim studentgrade As Integer
    '    Dim assignmentnames As New List(Of String)
    '    Dim reader As MySqlDataReader

    '    cboAssignment.Items.Clear()
    '    classname = cboClass.SelectedItem

    '    mysqlServer = New MySqlConnection() 'This needs to be able to be changed to what frmSettings.txtServer is saved to
    '    mysqlServer.ConnectionString = frmSplash.SQLConnection1.getConnectionString


    '    Try
    '        mysqlServer.Open()
    '    Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '    End Try

    '    Dim tempstudent As Student
    '    Dim studentid As Integer
    '    For index As Integer = 0 To student.Count - 1
    '        tempstudent = student.Item(index)
    '        If lstStudents.SelectedItem = tempstudent.getname Then
    '            studentid = tempstudent.getid
    '        End If
    '    Next

    '    studentgradeSQL = "select grade from mdl_assignment_submissions where assignment = " & assignmentid & " and userid = " & studentid & ";"
    '    myCommand.Connection = mysqlServer
    '    myCommand.CommandText = studentgradeSQL
    '    reader = myCommand.ExecuteReader()
    '    While reader.Read()
    '        studentgrade = reader.GetString(0)
    '    End While
    '    reader.Close()
    '    mysqlServer.Close()

    '    If studentgrade = -1 Then
    '        chkGrade.Checked = True
    '        txtGrade.ReadOnly = True
    '        txtGrade.Text = ""
    '    Else
    '        txtGrade.ReadOnly = False
    '        chkGrade.Checked = False
    '        txtGrade.Text = studentgrade
    '    End If
    'End Sub

    'Private Sub cmdSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSave.Click
    '    Dim courseidSQL
    '    Dim studentgradeSQL
    '    Dim mysqlServer As MySqlConnection
    '    Dim myCommand As New MySqlCommand
    '    mysqlServer = New MySqlConnection() 'This needs to be able to be changed to what frmSettings.txtServer is saved to
    '    mysqlServer.ConnectionString = frmSplash.SQLConnection1.getConnectionString

    '    Try
    '        mysqlServer.Open()
    '    Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '    End Try

    '    myCommand.Connection = mysqlServer

    '    Dim reader As MySqlDataReader

    '    Try 'Translate the course name to it's SQL ID
    '        courseidSQL = "select id from mdl_course where fullname = """ & classname & """;"
    '        myCommand.Connection = mysqlServer
    '        myCommand.CommandText = courseidSQL
    '        reader = myCommand.ExecuteReader()
    '        While reader.Read()
    '            ' MsgBox(reader.GetString(0))
    '            courseid = reader.GetString(0)
    '        End While
    '        reader.Close()
    '    Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '        MsgBox("Could not translate the specified course name to it's ID.", MsgBoxStyle.OkOnly, "Error GSC01") 'Grade, Save, Course, error 1
    '    End Try

    '    Dim studentid As Integer
    '    Dim tempstudent As Student
    '    For index As Integer = 0 To student.Count - 1
    '        tempstudent = student.Item(index)
    '        If lstStudents.SelectedItem = tempstudent.getname Then
    '            studentid = tempstudent.getid
    '        End If
    '    Next
    '    Dim grade As String
    '    If chkGrade.Checked = True Then
    '        txtGrade.ReadOnly = True
    '        grade = "-1"
    '    Else
    '        txtGrade.ReadOnly = False
    '        grade = txtGrade.Text
    '    End If


    '    studentgradeSQL = "update mdl_assignment_submissions set grade = " & grade & " where assignment = " & assignmentid & " and userid = " & studentid & ";"
    '    myCommand.Connection = mysqlServer
    '    myCommand.CommandText = studentgradeSQL
    '    myCommand.ExecuteScalar()
    '    myCommand.Connection.Close()

    '    Dim feedback As String
    '    feedback = txtFeedback.Text
    '    feedback = addfeedback(feedback, grade)

    '    myCommand.Connection.Open()
    '    myCommand.Connection = mysqlServer
    '    myCommand.CommandText = "update mdl_assignment_submissions set submissioncomment = """ & feedback & """ where assignment = " & assignmentid & " and userid = " & studentid & ";"
    '    myCommand.ExecuteScalar()
    '    myCommand.Connection.Close()



    'End Sub

    'Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click
    '    Dim mysqlServer As MySqlConnection
    '    Dim myCommand As New MySqlCommand
    '    Dim assignmentupdateSQL As String
    '    mysqlServer = New MySqlConnection() 'This needs to be able to be changed to what frmSettings.txtServer is saved to
    '    mysqlServer.ConnectionString = frmSplash.SQLConnection1.getConnectionString

    '    Try
    '        mysqlServer.Open()
    '    Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '    End Try

    '    assignmentupdateSQL = "update mdl_assignment set grade = " & txtTotalValue.Text & " where id = " & assignmentid & ";"
    '    myCommand.Connection = mysqlServer
    '    myCommand.CommandText = assignmentupdateSQL
    '    myCommand.BeginExecuteNonQuery()

    '    Call showassignmentvalue()
    'End Sub

    'Private Sub chkGrade_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkGrade.CheckedChanged
    '    If chkGrade.Checked = True Then
    '        txtGrade.ReadOnly = True
    '    Else
    '        txtGrade.ReadOnly = False
    '    End If
    'End Sub

    'Private Sub cmdSaveNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSaveNext.Click
    '    Call cmdSave_Click(sender, e)
    '    If lstStudents.SelectedIndex = lstStudents.Items.Count() Then
    '        'Do nothing
    '    Else
    '        lstStudents.SelectedIndex = lstStudents.SelectedIndex + 1
    '    End If
    'End Sub

    'Private Sub cmdFinished_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFinished.Click

    '    Dim courseidSQL
    '    Dim studentgradeSQL
    '    Dim mysqlServer As MySqlConnection
    '    Dim myCommand As New MySqlCommand
    '    mysqlServer = New MySqlConnection() 'This needs to be able to be changed to what frmSettings.txtServer is saved to
    '    mysqlServer.ConnectionString = frmSplash.SQLConnection1.getConnectionString

    '    Try
    '        mysqlServer.Open()
    '    Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '    End Try

    '    myCommand.Connection = mysqlServer

    '    Dim reader As MySqlDataReader

    '    Try 'Translate the course name to it's SQL ID
    '        courseidSQL = "select id from mdl_course where fullname = """ & classname & """;"
    '        myCommand.Connection = mysqlServer
    '        myCommand.CommandText = courseidSQL
    '        reader = myCommand.ExecuteReader()
    '        While reader.Read()
    '            ' MsgBox(reader.GetString(0))
    '            courseid = reader.GetString(0)
    '        End While
    '        reader.Close()
    '    Catch myerror As MySqlException
    '        MessageBox.Show("Error connecting to the database: " & myerror.Message)
    '        MsgBox("Could not translate the specified course name to it's ID.", MsgBoxStyle.OkOnly, "Error GSC01") 'Grade, Save, Course, error 1
    '    End Try



    '    For index As Integer = 0 To lstNotSubmitted.Items.Count() - 1
    '        Dim studentid As Integer
    '        studentid = lstNotSubmitted.Items(index)
    '        studentgradeSQL = "update mdl_assignment_submissions set grade = 0 where assignment = " & assignmentid & " and userid = " & studentid & ";"
    '        myCommand.Connection = mysqlServer
    '        myCommand.CommandText = studentgradeSQL
    '        myCommand.ExecuteScalar()
    '        myCommand.Connection.Close()

    '        myCommand.Connection.Open()
    '        myCommand.Connection = mysqlServer
    '        myCommand.CommandText = "update mdl_assignment_submissions set submissioncomment = ""Assignment not submitted"" where assignment = " & assignmentid & " and userid = " & studentid & ";"
    '        myCommand.ExecuteScalar()
    '        myCommand.Connection.Close()
    '    Next


    '    Me.Hide()
    '    frmMain.Show()
    '    frmMain.Focus()
    'End Sub

    'Private Function addfeedback(ByVal s As String, ByVal grade As String) As String
    '    If chkCommentGoodjob.Checked = True Then
    '        s = s + "  Good Job."
    '    End If
    '    If chkCommentEffort.Checked = True Then
    '        s = s + "  Good Effort."
    '    End If

    '    If chkGradePoints.Checked = True And chkGrade.Checked = False Then
    '        s = s + "  " & grade & "/" & assignmentvalue
    '    End If

    '    If chkGradePercentage.Checked = True And chkGrade.Checked = False Then
    '        Dim percent As Double
    '        Dim tempint As Integer
    '        tempint = Convert.ToInt32(grade)
    '        percent = Int(tempint / assignmentvalue * 100)
    '        s = s + "  " & percent & "%"
    '    End If
    '    Return s
    'End Function
End Class


